package org.chen.ly.config;// QdrantConfig.java
import io.qdrant.client.QdrantClient;
import io.qdrant.client.QdrantGrpcClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class QdrantConfig {

    @Value("${qdrant.host:8.219.169.114}")
    private String host;

    @Value("${qdrant.port:6333}")
    private int grpcPort;

    @Value("${qdrant.api-key:LZ@nKvnvG6m6gCy}")
    private String apiKey;

    @Bean
    public QdrantClient qdrantClient() {
        return new QdrantClient(
            QdrantGrpcClient.newBuilder(host, grpcPort, true)
                .withApiKey(apiKey)
                .build()
        );
    }
}